#Load the library and Create Reference to Library object 
require 'test\unit'
require 'watir'
include Watir
include Test::Unit::Assertions

# define variables
testURL = 'http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ListSearch/ListSearch.aspx'
ie = Watir::IE.new

puts 'tests execution started'

def checkList(listId, ie)
  i=0;
  a = Array.new(ie.select_list(:id, listId).getAllContents)
  size = a.size
  while i<size do
    ie.select_list(:id,listId).set(a[i])
    assert_equal(a[i], ie.select_list(:id,listId).value)
    i=i+1
  end
  return
end
1.times do
  ie.goto testURL
  checkList('ctl00_SampleContent_ListBox1', ie)
  checkList('ctl00_SampleContent_DropDownList1', ie)
  ie.close
end

puts 'tests execution finished'